Rate Limiter
class RateLimiter
JS/TS-friendly facade over com.sorinirmies.arrow.resiliencekit.RateLimiter (token bucket).
import { RateLimiter } from "arrow-resilience-kit";
const rl = await RateLimiter.create({ permitsPerSecond: 10, burstCapacity: 20 });
const result = await rl.execute(() => api.request());Content copied to clipboard
Functions
Link copied to clipboard
Current number of available tokens.
Link copied to clipboard
Resets statistics counters (not the available-token balance).
Link copied to clipboard
Current statistics snapshot.
Link copied to clipboard
Tries to acquire permits tokens without executing anything. Resolves true if acquired.
Link copied to clipboard